home *** CD-ROM | disk | FTP | other *** search
/ Macwelt 4 / Macwelt DVD 4.cdr / Entwickler / Mac-OS / oxygen / samples / docbook / xsl / html / chunk-common.xsl < prev    next >
Encoding:
Extensible Markup Language  |  2002-09-09  |  26.1 KB  |  739 lines  |  [□□□□/□□□□]

  1. chunk-common.xslf%π¢tÚπ¢tÚÅÅ—Ó<?xml version="1.0"?>
  2. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  3.                 version="1.0">
  4.  
  5. <xsl:template name="chunk">
  6.   <xsl:param name="node" select="."/>
  7.   <!-- returns 1 if $node is a chunk -->
  8.  
  9.   <!-- ==================================================================== -->
  10.   <!-- What's a chunk?
  11.  
  12.        The root element
  13.        appendix
  14.        article
  15.        bibliography  in article or book
  16.        book
  17.        chapter
  18.        colophon
  19.        glossary      in article or book
  20.        index         in article or book
  21.        part
  22.        preface
  23.        refentry
  24.        reference
  25.        sect{1,2,3,4,5}  if position()>1 && depth < chunk.section.depth
  26.        section          if position()>1 && depth < chunk.section.depth
  27.        set
  28.        setindex
  29.                                                                             -->
  30.   <!-- ==================================================================== -->
  31.  
  32. <!--
  33.   <xsl:message>
  34.     <xsl:text>chunk: </xsl:text>
  35.     <xsl:value-of select="name($node)"/>
  36.     <xsl:text>(</xsl:text>
  37.     <xsl:value-of select="$node/@id"/>
  38.     <xsl:text>)</xsl:text>
  39.     <xsl:text> csd: </xsl:text>
  40.     <xsl:value-of select="$chunk.section.depth"/>
  41.     <xsl:text> cfs: </xsl:text>
  42.     <xsl:value-of select="$chunk.first.sections"/>
  43.     <xsl:text> ps: </xsl:text>
  44.     <xsl:value-of select="count($node/parent::section)"/>
  45.     <xsl:text> prs: </xsl:text>
  46.     <xsl:value-of select="count($node/preceding-sibling::section)"/>
  47.   </xsl:message>
  48. -->
  49.  
  50.   <xsl:choose>
  51.     <xsl:when test="not($node/parent::*)">1</xsl:when>
  52.  
  53.     <xsl:when test="local-name($node) = 'sect1'
  54.                     and $chunk.section.depth >= 1
  55.                     and ($chunk.first.sections != 0
  56.                          or count($node/preceding-sibling::sect1) > 0)">
  57.       <xsl:text>1</xsl:text>
  58.     </xsl:when>
  59.     <xsl:when test="local-name($node) = 'sect2'
  60.                     and $chunk.section.depth >= 2
  61.                     and ($chunk.first.sections != 0
  62.                          or count($node/preceding-sibling::sect2) > 0)">
  63.       <xsl:call-template name="chunk">
  64.         <xsl:with-param name="node" select="$node/parent::*"/>
  65.       </xsl:call-template>
  66.     </xsl:when>
  67.     <xsl:when test="local-name($node) = 'sect3'
  68.                     and $chunk.section.depth >= 3
  69.                     and ($chunk.first.sections != 0
  70.                          or count($node/preceding-sibling::sect3) > 0)">
  71.       <xsl:call-template name="chunk">
  72.         <xsl:with-param name="node" select="$node/parent::*"/>
  73.       </xsl:call-template>
  74.     </xsl:when>
  75.     <xsl:when test="local-name($node) = 'sect4'
  76.                     and $chunk.section.depth >= 4
  77.                     and ($chunk.first.sections != 0
  78.                          or count($node/preceding-sibling::sect4) > 0)">
  79.       <xsl:call-template name="chunk">
  80.         <xsl:with-param name="node" select="$node/parent::*"/>
  81.       </xsl:call-template>
  82.     </xsl:when>
  83.     <xsl:when test="local-name($node) = 'sect5'
  84.                     and $chunk.section.depth >= 5
  85.                     and ($chunk.first.sections != 0
  86.                          or count($node/preceding-sibling::sect5) > 0)">
  87.       <xsl:call-template name="chunk">
  88.         <xsl:with-param name="node" select="$node/parent::*"/>
  89.       </xsl:call-template>
  90.     </xsl:when>
  91.     <xsl:when test="local-name($node) = 'section'
  92.                     and $chunk.section.depth >= count(ancestor::section)+1
  93.                     and ($chunk.first.sections != 0
  94.                          or count($node/preceding-sibling::section) > 0)">
  95.       <xsl:call-template name="chunk">
  96.         <xsl:with-param name="node" select="$node/parent::*"/>
  97.       </xsl:call-template>
  98.     </xsl:when>
  99.  
  100.     <xsl:when test="name($node)='preface'">1</xsl:when>
  101.     <xsl:when test="name($node)='chapter'">1</xsl:when>
  102.     <xsl:when test="name($node)='appendix'">1</xsl:when>
  103.     <xsl:when test="name($node)='article'">1</xsl:when>
  104.     <xsl:when test="name($node)='part'">1</xsl:when>
  105.     <xsl:when test="name($node)='reference'">1</xsl:when>
  106.     <xsl:when test="name($node)='refentry'">1</xsl:when>
  107.     <xsl:when test="name($node)='index'
  108.                     and (name($node/parent::*) = 'article'
  109.                          or name($node/parent::*) = 'book')">1</xsl:when>
  110.     <xsl:when test="name($node)='bibliography'
  111.                     and (name($node/parent::*) = 'article'
  112.                          or name($node/parent::*) = 'book')">1</xsl:when>
  113.     <xsl:when test="name($node)='glossary'
  114.                     and (name($node/parent::*) = 'article'
  115.                          or name($node/parent::*) = 'book')">1</xsl:when>
  116.     <xsl:when test="name($node)='colophon'">1</xsl:when>
  117.     <xsl:when test="name($node)='book'">1</xsl:when>
  118.     <xsl:when test="name($node)='set'">1</xsl:when>
  119.     <xsl:when test="name($node)='setindex'">1</xsl:when>
  120.     <xsl:otherwise>0</xsl:otherwise>
  121.   </xsl:choose>
  122. </xsl:template>
  123.  
  124. <!-- ==================================================================== -->
  125.  
  126. <xsl:template match="*" mode="chunk-filename">
  127.   <xsl:param name="recursive" select="false()"/>
  128.  
  129.   <!-- returns the filename of a chunk -->
  130.   <xsl:variable name="ischunk">
  131.     <xsl:call-template name="chunk"/>
  132.   </xsl:variable>
  133.  
  134. <!--
  135.   <xsl:message>
  136.     <xsl:value-of select="local-name(.)"/>
  137.     <xsl:if test="@id">
  138.       <xsl:text> [</xsl:text>
  139.       <xsl:value-of select="@id"/>
  140.       <xsl:text>]</xsl:text>
  141.     </xsl:if>
  142.     <xsl:text>, </xsl:text>
  143.     <xsl:value-of select="$ischunk"/>
  144.   </xsl:message>
  145. -->
  146.  
  147.   <xsl:variable name="dbhtml-filename">
  148.     <xsl:call-template name="dbhtml-filename"/>
  149.   </xsl:variable>
  150.  
  151.   <xsl:variable name="filename">
  152.     <xsl:choose>
  153.       <xsl:when test="$dbhtml-filename != ''">
  154.         <xsl:value-of select="$dbhtml-filename"/>
  155.       </xsl:when>
  156.       <!-- if this is the root element, use the root.filename -->
  157.       <xsl:when test="not(parent::*) and $root.filename != ''">
  158.         <xsl:value-of select="$root.filename"/>
  159.         <xsl:value-of select="$html.ext"/>
  160.       </xsl:when>
  161.       <!-- if there's no dbhtml filename, and if we're to use IDs as -->
  162.       <!-- filenames, then use the ID to generate the filename. -->
  163.       <xsl:when test="@id and $use.id.as.filename != 0">
  164.         <xsl:value-of select="@id"/>
  165.         <xsl:value-of select="$html.ext"/>
  166.       </xsl:when>
  167.       <xsl:otherwise></xsl:otherwise>
  168.     </xsl:choose>
  169.   </xsl:variable>
  170.  
  171.   <xsl:variable name="dir">
  172.     <xsl:call-template name="dbhtml-dir"/>
  173.   </xsl:variable>
  174.  
  175.   <xsl:choose>
  176.     <xsl:when test="$ischunk='0'">
  177.       <!-- if called on something that isn't a chunk, walk up... -->
  178.       <xsl:choose>
  179.         <xsl:when test="count(parent::*)>0">
  180.           <xsl:apply-templates mode="chunk-filename" select="parent::*">
  181.             <xsl:with-param name="recursive" select="$recursive"/>
  182.           </xsl:apply-templates>
  183.         </xsl:when>
  184.         <!-- unless there is no up, in which case return "" -->
  185.         <xsl:otherwise></xsl:otherwise>
  186.       </xsl:choose>
  187.     </xsl:when>
  188.  
  189.     <xsl:when test="not($recursive) and $filename != ''">
  190.       <!-- if this chunk has an explicit name, use it -->
  191.       <xsl:if test="$dir != ''">
  192.         <xsl:value-of select="$dir"/>
  193.         <xsl:text>/</xsl:text>
  194.       </xsl:if>
  195.       <xsl:value-of select="$filename"/>
  196.     </xsl:when>
  197.  
  198.     <xsl:when test="name(.)='set'">
  199.       <xsl:value-of select="$root.filename"/>
  200.       <xsl:if test="not($recursive)">
  201.         <xsl:value-of select="$html.ext"/>
  202.       </xsl:if>
  203.     </xsl:when>
  204.  
  205.     <xsl:when test="name(.)='book'">
  206.       <xsl:text>bk</xsl:text>
  207.       <xsl:number level="any" format="01"/>
  208.       <xsl:if test="not($recursive)">
  209.         <xsl:value-of select="$html.ext"/>
  210.       </xsl:if>
  211.     </xsl:when>
  212.  
  213.     <xsl:when test="name(.)='article'">
  214.       <xsl:if test="/set">
  215.         <!-- in a set, make sure we inherit the right book info... -->
  216.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  217.           <xsl:with-param name="recursive" select="true()"/>
  218.         </xsl:apply-templates>
  219.       </xsl:if>
  220.       <xsl:text>ar</xsl:text>
  221.       <xsl:number level="any" format="01" from="book"/>
  222.       <xsl:if test="not($recursive)">
  223.         <xsl:value-of select="$html.ext"/>
  224.       </xsl:if>
  225.     </xsl:when>
  226.  
  227.     <xsl:when test="name(.)='preface'">
  228.       <xsl:if test="/set">
  229.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  230.           <xsl:with-param name="recursive" select="true()"/>
  231.         </xsl:apply-templates>
  232.       </xsl:if>
  233.       <xsl:text>pr</xsl:text>
  234.       <xsl:number level="any" format="01" from="book"/>
  235.       <xsl:if test="not($recursive)">
  236.         <xsl:value-of select="$html.ext"/>
  237.       </xsl:if>
  238.     </xsl:when>
  239.  
  240.     <xsl:when test="name(.)='chapter'">
  241.       <xsl:if test="/set">
  242.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  243.           <xsl:with-param name="recursive" select="true()"/>
  244.         </xsl:apply-templates>
  245.       </xsl:if>
  246.       <xsl:text>ch</xsl:text>
  247.       <xsl:number level="any" format="01" from="book"/>
  248.       <xsl:if test="not($recursive)">
  249.         <xsl:value-of select="$html.ext"/>
  250.       </xsl:if>
  251.     </xsl:when>
  252.  
  253.     <xsl:when test="name(.)='appendix'">
  254.       <xsl:if test="/set">
  255.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  256.           <xsl:with-param name="recursive" select="true()"/>
  257.         </xsl:apply-templates>
  258.       </xsl:if>
  259.       <xsl:text>ap</xsl:text>
  260.       <xsl:number level="any" format="a" from="book"/>
  261.       <xsl:if test="not($recursive)">
  262.         <xsl:value-of select="$html.ext"/>
  263.       </xsl:if>
  264.     </xsl:when>
  265.  
  266.     <xsl:when test="name(.)='part'">
  267.       <xsl:if test="/set">
  268.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  269.           <xsl:with-param name="recursive" select="true()"/>
  270.         </xsl:apply-templates>
  271.       </xsl:if>
  272.       <xsl:text>pt</xsl:text>
  273.       <xsl:number level="any" format="01" from="book"/>
  274.       <xsl:if test="not($recursive)">
  275.         <xsl:value-of select="$html.ext"/>
  276.       </xsl:if>
  277.     </xsl:when>
  278.  
  279.     <xsl:when test="name(.)='reference'">
  280.       <xsl:if test="/set">
  281.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  282.           <xsl:with-param name="recursive" select="true()"/>
  283.         </xsl:apply-templates>
  284.       </xsl:if>
  285.       <xsl:text>rn</xsl:text>
  286.       <xsl:number level="any" format="01" from="book"/>
  287.       <xsl:if test="not($recursive)">
  288.         <xsl:value-of select="$html.ext"/>
  289.       </xsl:if>
  290.     </xsl:when>
  291.  
  292.     <xsl:when test="name(.)='refentry'">
  293.       <xsl:if test="parent::reference">
  294.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  295.           <xsl:with-param name="recursive" select="true()"/>
  296.         </xsl:apply-templates>
  297.       </xsl:if>
  298.       <xsl:text>re</xsl:text>
  299.       <xsl:number level="any" format="01" from="book"/>
  300.       <xsl:if test="not($recursive)">
  301.         <xsl:value-of select="$html.ext"/>
  302.       </xsl:if>
  303.     </xsl:when>
  304.  
  305.     <xsl:when test="name(.)='colophon'">
  306.       <xsl:if test="/set">
  307.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  308.           <xsl:with-param name="recursive" select="true()"/>
  309.         </xsl:apply-templates>
  310.       </xsl:if>
  311.       <xsl:text>co</xsl:text>
  312.       <xsl:number level="any" format="01" from="book"/>
  313.       <xsl:if test="not($recursive)">
  314.         <xsl:value-of select="$html.ext"/>
  315.       </xsl:if>
  316.     </xsl:when>
  317.  
  318.     <xsl:when test="local-name(.) = 'sect1'
  319.                     or local-name(.) = 'sect2'
  320.                     or local-name(.) = 'sect3'
  321.                     or local-name(.) = 'sect4'
  322.                     or local-name(.) = 'sect5'
  323.                     or local-name(.) = 'section'">
  324.       <xsl:apply-templates mode="chunk-filename" select="parent::*">
  325.         <xsl:with-param name="recursive" select="true()"/>
  326.       </xsl:apply-templates>
  327.       <xsl:text>s</xsl:text>
  328.       <xsl:number format="01"/>
  329.       <xsl:if test="not($recursive)">
  330.         <xsl:value-of select="$html.ext"/>
  331.       </xsl:if>
  332.     </xsl:when>
  333.  
  334.     <xsl:when test="name(.)='sect1' or name(.)='section'">
  335.       <xsl:apply-templates mode="chunk-filename" select="parent::*">
  336.         <xsl:with-param name="recursive" select="true()"/>
  337.       </xsl:apply-templates>
  338.       <xsl:text>s</xsl:text>
  339.       <xsl:number level="any" format="01" from="preface|chapter|appendix"/>
  340.       <xsl:if test="not($recursive)">
  341.         <xsl:value-of select="$html.ext"/>
  342.       </xsl:if>
  343.     </xsl:when>
  344.  
  345.     <xsl:when test="name(.)='bibliography'">
  346.       <xsl:if test="/set">
  347.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  348.           <xsl:with-param name="recursive" select="true()"/>
  349.         </xsl:apply-templates>
  350.       </xsl:if>
  351.       <xsl:text>bi</xsl:text>
  352.       <xsl:number level="any" format="01" from="book"/>
  353.       <xsl:if test="not($recursive)">
  354.         <xsl:value-of select="$html.ext"/>
  355.       </xsl:if>
  356.     </xsl:when>
  357.  
  358.     <xsl:when test="name(.)='glossary'">
  359.       <xsl:if test="/set">
  360.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  361.           <xsl:with-param name="recursive" select="true()"/>
  362.         </xsl:apply-templates>
  363.       </xsl:if>
  364.       <xsl:text>go</xsl:text>
  365.       <xsl:number level="any" format="01" from="book"/>
  366.       <xsl:if test="not($recursive)">
  367.         <xsl:value-of select="$html.ext"/>
  368.       </xsl:if>
  369.     </xsl:when>
  370.  
  371.     <xsl:when test="name(.)='index'">
  372.       <xsl:if test="/set">
  373.         <xsl:apply-templates mode="chunk-filename" select="parent::*">
  374.           <xsl:with-param name="recursive" select="true()"/>
  375.         </xsl:apply-templates>
  376.       </xsl:if>
  377.       <xsl:text>ix</xsl:text>
  378.       <xsl:number level="any" format="01" from="book"/>
  379.       <xsl:if test="not($recursive)">
  380.         <xsl:value-of select="$html.ext"/>
  381.       </xsl:if>
  382.     </xsl:when>
  383.  
  384.     <xsl:when test="name(.)='setindex'">
  385.       <xsl:text>si</xsl:text>
  386.       <xsl:number level="any" format="01" from="set"/>
  387.       <xsl:if test="not($recursive)">
  388.         <xsl:value-of select="$html.ext"/>
  389.       </xsl:if>
  390.     </xsl:when>
  391.  
  392.     <xsl:otherwise>
  393.       <xsl:text>chunk-filename-error-</xsl:text>
  394.       <xsl:value-of select="name(.)"/>
  395.       <xsl:number level="any" format="01" from="set"/>
  396.       <xsl:if test="not($recursive)">
  397.         <xsl:value-of select="$html.ext"/>
  398.       </xsl:if>
  399.     </xsl:otherwise>
  400.   </xsl:choose>
  401. </xsl:template>
  402.  
  403. <!-- ==================================================================== -->
  404.  
  405. <xsl:template name="href.target">
  406.   <xsl:param name="object" select="."/>
  407.   <xsl:variable name="ischunk">
  408.     <xsl:call-template name="chunk">
  409.       <xsl:with-param name="node" select="$object"/>
  410.     </xsl:call-template>
  411.   </xsl:variable>
  412.  
  413.   <xsl:apply-templates mode="chunk-filename" select="$object"/>
  414.  
  415.   <xsl:if test="$ischunk='0'">
  416.     <xsl:text>#</xsl:text>
  417.     <xsl:call-template name="object.id">
  418.       <xsl:with-param name="object" select="$object"/>
  419.     </xsl:call-template>
  420.   </xsl:if>
  421. </xsl:template>
  422.  
  423. <!-- ==================================================================== -->
  424.  
  425. <xsl:template name="html.head">
  426.   <xsl:param name="prev" select="/foo"/>
  427.   <xsl:param name="next" select="/foo"/>
  428.   <xsl:variable name="home" select="/*[1]"/>
  429.   <xsl:variable name="up" select="parent::*"/>
  430.  
  431.   <head>
  432.     <xsl:call-template name="head.content"/>
  433.     <xsl:call-template name="user.head.content"/>
  434.  
  435.     <xsl:if test="$home">
  436.       <link rel="home">
  437.         <xsl:attribute name="href">
  438.           <xsl:call-template name="href.target">
  439.             <xsl:with-param name="object" select="$home"/>
  440.           </xsl:call-template>
  441.         </xsl:attribute>
  442.         <xsl:attribute name="title">
  443.           <xsl:apply-templates select="$home"
  444.                                mode="object.title.markup.textonly"/>
  445.         </xsl:attribute>
  446.       </link>
  447.     </xsl:if>
  448.  
  449.     <xsl:if test="$up">
  450.       <link rel="up">
  451.         <xsl:attribute name="href">
  452.           <xsl:call-template name="href.target">
  453.             <xsl:with-param name="object" select="$up"/>
  454.           </xsl:call-template>
  455.         </xsl:attribute>
  456.         <xsl:attribute name="title">
  457.           <xsl:apply-templates select="$up" mode="object.title.markup.textonly"/>
  458.         </xsl:attribute>
  459.       </link>
  460.     </xsl:if>
  461.  
  462.     <xsl:if test="$prev">
  463.       <link rel="previous">
  464.         <xsl:attribute name="href">
  465.           <xsl:call-template name="href.target">
  466.             <xsl:with-param name="object" select="$prev"/>
  467.           </xsl:call-template>
  468.         </xsl:attribute>
  469.         <xsl:attribute name="title">
  470.           <xsl:apply-templates select="$prev" mode="object.title.markup.textonly"/>
  471.         </xsl:attribute>
  472.       </link>
  473.     </xsl:if>
  474.  
  475.     <xsl:if test="$next">
  476.       <link rel="next">
  477.         <xsl:attribute name="href">
  478.           <xsl:call-template name="href.target">
  479.             <xsl:with-param name="object" select="$next"/>
  480.           </xsl:call-template>
  481.         </xsl:attribute>
  482.         <xsl:attribute name="title">
  483.           <xsl:apply-templates select="$next" mode="object.title.markup.textonly"/>
  484.         </xsl:attribute>
  485.       </link>
  486.     </xsl:if>
  487.   </head>
  488. </xsl:template>
  489.  
  490. <!-- ==================================================================== -->
  491.  
  492. <xsl:template name="header.navigation">
  493.   <xsl:param name="prev" select="/foo"/>
  494.   <xsl:param name="next" select="/foo"/>
  495.   <xsl:variable name="home" select="/*[1]"/>
  496.   <xsl:variable name="up" select="parent::*"/>
  497.  
  498.   <xsl:if test="$suppress.navigation = '0'">
  499.     <div class="navheader">
  500.       <table width="100%" summary="Navigation header">
  501.     <xsl:if test="$navig.showtitles != 0">
  502.       <tr>
  503.         <th colspan="3" align="center">
  504.               <xsl:apply-templates select="." mode="object.title.markup"/>
  505.             </th>
  506.           </tr>
  507.         </xsl:if>
  508.         <tr>
  509.           <td width="20%" align="left">
  510.             <xsl:if test="count($prev)>0">
  511.               <a accesskey="p">
  512.                 <xsl:attribute name="href">
  513.                   <xsl:call-template name="href.target">
  514.                     <xsl:with-param name="object" select="$prev"/>
  515.                   </xsl:call-template>
  516.                 </xsl:attribute>
  517.                 <xsl:call-template name="navig.content">
  518.             <xsl:with-param name="direction" select="'prev'"/>
  519.         </xsl:call-template>
  520.               </a>
  521.             </xsl:if>
  522.             <xsl:text> </xsl:text>
  523.           </td>
  524.           <th width="60%" align="center">
  525.             <xsl:choose>
  526.               <xsl:when test="count($up) > 0 and $up != $home and $navig.showtitles != 0">
  527.                 <xsl:apply-templates select="$up" mode="object.title.markup"/>
  528.               </xsl:when>
  529.               <xsl:otherwise> </xsl:otherwise>
  530.             </xsl:choose>
  531.           </th>
  532.           <td width="20%" align="right">
  533.             <xsl:text> </xsl:text>
  534.             <xsl:if test="count($next)>0">
  535.               <a accesskey="n">
  536.                 <xsl:attribute name="href">
  537.                   <xsl:call-template name="href.target">
  538.                     <xsl:with-param name="object" select="$next"/>
  539.                   </xsl:call-template>
  540.                 </xsl:attribute>
  541.                 <xsl:call-template name="navig.content">
  542.             <xsl:with-param name="direction" select="'next'"/>
  543.         </xsl:call-template>
  544.               </a>
  545.             </xsl:if>
  546.           </td>
  547.         </tr>
  548.       </table>
  549.       <hr/>
  550.     </div>
  551.   </xsl:if>
  552. </xsl:template>
  553.  
  554. <!-- ==================================================================== -->
  555.  
  556. <xsl:template name="footer.navigation">
  557.   <xsl:param name="prev" select="/foo"/>
  558.   <xsl:param name="next" select="/foo"/>
  559.   <xsl:variable name="home" select="/*[1]"/>
  560.   <xsl:variable name="up" select="parent::*"/>
  561.  
  562.   <xsl:if test="$suppress.navigation = '0'">
  563.     <div class="navfooter">
  564.       <hr/>
  565.       <table width="100%" summary="Navigation footer">
  566.         <tr>
  567.           <td width="40%" align="left">
  568.             <xsl:if test="count($prev)>0">
  569.               <a accesskey="p">
  570.                 <xsl:attribute name="href">
  571.                   <xsl:call-template name="href.target">
  572.                     <xsl:with-param name="object" select="$prev"/>
  573.                   </xsl:call-template>
  574.                 </xsl:attribute>
  575.         <xsl:call-template name="navig.content">
  576.             <xsl:with-param name="direction" select="'prev'"/>
  577.         </xsl:call-template>
  578.           </a>
  579.             </xsl:if>
  580.             <xsl:text> </xsl:text>
  581.           </td>
  582.           <td width="20%" align="center">
  583.             <xsl:choose>
  584.               <xsl:when test="count($up)>0">
  585.                 <a accesskey="u">
  586.                   <xsl:attribute name="href">
  587.                     <xsl:call-template name="href.target">
  588.                       <xsl:with-param name="object" select="$up"/>
  589.                     </xsl:call-template>
  590.                   </xsl:attribute>
  591.                   <xsl:call-template name="navig.content">
  592.               <xsl:with-param name="direction" select="'up'"/>
  593.           </xsl:call-template>
  594.                 </a>
  595.               </xsl:when>
  596.               <xsl:otherwise> </xsl:otherwise>
  597.             </xsl:choose>
  598.           </td>
  599.           <td width="40%" align="right">
  600.             <xsl:text> </xsl:text>
  601.             <xsl:if test="count($next)>0">
  602.               <a accesskey="n">
  603.                 <xsl:attribute name="href">
  604.                   <xsl:call-template name="href.target">
  605.                     <xsl:with-param name="object" select="$next"/>
  606.                   </xsl:call-template>
  607.                 </xsl:attribute>
  608.                 <xsl:call-template name="navig.content">
  609.             <xsl:with-param name="direction" select="'next'"/>
  610.         </xsl:call-template>
  611.               </a>
  612.             </xsl:if>
  613.           </td>
  614.         </tr>
  615.  
  616.         <tr>
  617.           <td width="40%" align="left" valign="top">
  618.         <xsl:if test="$navig.showtitles != 0">
  619.               <xsl:apply-templates select="$prev" mode="object.title.markup"/>
  620.             </xsl:if>
  621.             <xsl:text> </xsl:text>
  622.           </td>
  623.           <td width="20%" align="center">
  624.             <xsl:choose>
  625.               <xsl:when test="$home != .">
  626.                 <a accesskey="h">
  627.                   <xsl:attribute name="href">
  628.                     <xsl:call-template name="href.target">
  629.                       <xsl:with-param name="object" select="$home"/>
  630.                     </xsl:call-template>
  631.                   </xsl:attribute>
  632.                   <xsl:call-template name="navig.content">
  633.             <xsl:with-param name="direction" select="'home'"/>
  634.           </xsl:call-template>
  635.                 </a>
  636.               </xsl:when>
  637.               <xsl:otherwise> </xsl:otherwise>
  638.             </xsl:choose>
  639.           </td>
  640.           <td width="40%" align="right" valign="top">
  641.             <xsl:text> </xsl:text>
  642.             <xsl:if test="$navig.showtitles != 0">
  643.               <xsl:apply-templates select="$next" mode="object.title.markup"/>
  644.         </xsl:if>
  645.           </td>
  646.         </tr>
  647.       </table>
  648.     </div>
  649.   </xsl:if>
  650. </xsl:template>
  651.  
  652. <!-- ==================================================================== -->
  653.  
  654. <xsl:template name="navig.content">
  655.     <xsl:param name="direction" select="next"/>
  656.     <xsl:variable name="navtext">
  657.         <xsl:choose>
  658.         <xsl:when test="$direction = 'prev'">
  659.         <xsl:call-template name="gentext.nav.prev"/>
  660.         </xsl:when>
  661.         <xsl:when test="$direction = 'next'">
  662.         <xsl:call-template name="gentext.nav.next"/>
  663.         </xsl:when>
  664.         <xsl:when test="$direction = 'up'">
  665.         <xsl:call-template name="gentext.nav.up"/>
  666.         </xsl:when>
  667.         <xsl:when test="$direction = 'home'">
  668.         <xsl:call-template name="gentext.nav.home"/>
  669.         </xsl:when>
  670.         <xsl:otherwise>
  671.         <xsl:text>xxx</xsl:text>
  672.         </xsl:otherwise>
  673.     </xsl:choose>
  674.     </xsl:variable>
  675.  
  676.     <xsl:choose>
  677.     <xsl:when test="$navig.graphics != 0">
  678.         <img>
  679.         <xsl:attribute name="src">
  680.             <xsl:value-of select="$navig.graphics.path"/>
  681.             <xsl:value-of select="$direction"/>
  682.             <xsl:value-of select="$navig.graphics.extension"/>
  683.         </xsl:attribute>
  684.         <xsl:attribute name="alt">
  685.             <xsl:value-of select="$navtext"/>
  686.         </xsl:attribute>
  687.         </img>
  688.     </xsl:when>
  689.     <xsl:otherwise>
  690.         <xsl:value-of select="$navtext"/>
  691.     </xsl:otherwise>
  692.     </xsl:choose>
  693. </xsl:template>
  694.  
  695. <!-- ==================================================================== -->
  696.  
  697. <xsl:template match="processing-instruction('dbhtml')">
  698.   <!-- nop -->
  699. </xsl:template>
  700.  
  701. <!-- ==================================================================== -->
  702.  
  703. <xsl:template name="chunk-element-content">
  704.   <xsl:param name="prev"></xsl:param>
  705.   <xsl:param name="next"></xsl:param>
  706.  
  707.   <html>
  708.     <xsl:call-template name="html.head">
  709.       <xsl:with-param name="prev" select="$prev"/>
  710.       <xsl:with-param name="next" select="$next"/>
  711.     </xsl:call-template>
  712.  
  713.     <body>
  714.       <xsl:call-template name="body.attributes"/>
  715.       <xsl:call-template name="user.header.navigation"/>
  716.  
  717.       <xsl:call-template name="header.navigation">
  718.     <xsl:with-param name="prev" select="$prev"/>
  719.     <xsl:with-param name="next" select="$next"/>
  720.       </xsl:call-template>
  721.  
  722.       <xsl:call-template name="user.header.content"/>
  723.  
  724.       <xsl:apply-imports/>
  725.  
  726.       <xsl:call-template name="user.footer.content"/>
  727.  
  728.       <xsl:call-template name="footer.navigation">
  729.     <xsl:with-param name="prev" select="$prev"/>
  730.     <xsl:with-param name="next" select="$next"/>
  731.       </xsl:call-template>
  732.  
  733.       <xsl:call-template name="user.footer.navigation"/>
  734.     </body>
  735.   </html>
  736. </xsl:template>
  737.  
  738. </xsl:stylesheet>
  739. This resource fork intentionally left blank   ˇˇ